package com.teach.controller;

import com.teach.pojo.RespBean;
import com.teach.service.ClassService;
import com.teach.service.ScoreService;
import com.teach.service.TimetableService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class ClassController {
    @Autowired
    private ClassService classService;
    @Autowired
    private TimetableService timetableService;
    @Autowired
    private ScoreService scoreService;

    @GetMapping("/getClass")
    public RespBean getClass(Long id) {
        return RespBean.success(classService.getClassByUserId(id));
    }

    @GetMapping("/getTimetable")
    public RespBean getTimetable(Long classId) {
        return RespBean.success(timetableService.getTables(classId));
    }

    @GetMapping("/getScores")
    private RespBean getScores(Long userId) {
        return scoreService.getScores(userId);
    }

}
